home *** CD-ROM | disk | FTP | other *** search
/ Resource Library: Multimedia / Resource Library: Multimedia.iso / hypercrd / xcmds / shwdlg16.hqx / ShowDialog XCMD 1.6 / card_6931.txt < prev    next >
Text File  |  1989-05-10  |  12KB  |  332 lines

  1. -- card: 6931 from stack: in.6
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 3411
  5. -- name: More Aux
  6. ----- HyperTalk script -----
  7. on turnOn buttonNo
  8.   lock screen
  9.   hide cd fld "Info"
  10.   hide bg fld "theResult"
  11.   repeat with counter = 1 to 4
  12.     if buttonNo = counter then
  13.       set the hilite of cd btn counter to TRUE
  14.       show bg fld counter
  15.     else
  16.       set the hilite of cd btn counter to FALSE
  17.       hide bg fld counter
  18.     end if
  19.   end repeat
  20.   set scroll of bg fld buttonNo to 0
  21.   show bg btn "Close Information"
  22.   unlock screen with visual effect dissolve
  23. end turnOn
  24.  
  25. on closeall
  26.   set cursor to watch
  27.   lock screen
  28.   repeat with x = 1 to 4
  29.     hide bg fld x
  30.     set hilite of cd btn x to FALSE
  31.   end repeat
  32.   hide bg btn "Close Information"
  33.   show cd fld "info"
  34.   show bg fld "theResult"
  35.   unlock screen with visual effect dissolve
  36. end closeall
  37.  
  38. on closecard
  39.   closeall
  40. end closecard
  41.  
  42. on printIt
  43.   put bg fld 1 & return & bg fld 2 & return & bg fld 3 & return & bg fld 4 into container
  44.   put bg fld "Title" into prompt
  45.   PrintDoc prompt,container,prompt,times,12
  46. end printIt
  47.  
  48.  
  49.  
  50. -- part 1 (field)
  51. -- low flags: 01
  52. -- high flags: 2000
  53. -- rect: left=124 top=50 right=83 bottom=391
  54. -- title width / last selected line: 0
  55. -- icon id / first selected line: 0 / 0
  56. -- text alignment: 0
  57. -- font id: 3
  58. -- text size: 10
  59. -- style flags: 0
  60. -- line height: 13
  61. -- part name: Info
  62.  
  63.  
  64. -- part 2 (button)
  65. -- low flags: 00
  66. -- high flags: A004
  67. -- rect: left=17 top=90 right=112 bottom=194
  68. -- title width / last selected line: 0
  69. -- icon id / first selected line: 0 / 0
  70. -- text alignment: 1
  71. -- font id: 0
  72. -- text size: 12
  73. -- style flags: 0
  74. -- line height: 16
  75. -- part name: SplashDialog XCMD
  76. ----- HyperTalk script -----
  77. on mouseUp
  78.   if the visible of bg fld (the number of me) then
  79.     closeall
  80.   else
  81.     put the number of me into displayinfo
  82.     turnOn displayinfo
  83.   end if
  84. end mouseUp
  85.  
  86.  
  87.  
  88. -- part 3 (button)
  89. -- low flags: 00
  90. -- high flags: A004
  91. -- rect: left=17 top=120 right=142 bottom=194
  92. -- title width / last selected line: 0
  93. -- icon id / first selected line: 0 / 0
  94. -- text alignment: 1
  95. -- font id: 0
  96. -- text size: 12
  97. -- style flags: 0
  98. -- line height: 16
  99. -- part name: CreditsDialog XCMD
  100. ----- HyperTalk script -----
  101. on mouseUp
  102.   if the visible of bg fld (the number of me) then
  103.     closeall
  104.   else
  105.     put the number of me into displayinfo
  106.     turnOn displayinfo
  107.   end if
  108. end mouseUp
  109.  
  110.  
  111.  
  112. -- part 4 (button)
  113. -- low flags: 00
  114. -- high flags: A004
  115. -- rect: left=17 top=150 right=172 bottom=194
  116. -- title width / last selected line: 0
  117. -- icon id / first selected line: 0 / 0
  118. -- text alignment: 1
  119. -- font id: 0
  120. -- text size: 12
  121. -- style flags: 0
  122. -- line height: 16
  123. -- part name: TextDialog XCMD
  124. ----- HyperTalk script -----
  125. on mouseUp
  126.   if the visible of bg fld (the number of me) then
  127.     closeall
  128.   else
  129.     put the number of me into displayinfo
  130.     turnOn displayinfo
  131.   end if
  132. end mouseUp
  133.  
  134.  
  135.  
  136. -- part 5 (button)
  137. -- low flags: 00
  138. -- high flags: A004
  139. -- rect: left=17 top=180 right=202 bottom=194
  140. -- title width / last selected line: 0
  141. -- icon id / first selected line: 0 / 0
  142. -- text alignment: 1
  143. -- font id: 0
  144. -- text size: 12
  145. -- style flags: 0
  146. -- line height: 16
  147. -- part name: 
  148. ----- HyperTalk script -----
  149. on mouseUp
  150.   if the visible of bg fld (the number of me) then
  151.     closeall
  152.   else
  153.     put the number of me into displayinfo
  154.     turnOn displayinfo
  155.   end if
  156. end mouseUp
  157.  
  158.  
  159.  
  160. -- part 6 (button)
  161. -- low flags: 00
  162. -- high flags: 0000
  163. -- rect: left=11 top=4 right=64 bottom=78
  164. -- title width / last selected line: 0
  165. -- icon id / first selected line: 529 / 529
  166. -- text alignment: 1
  167. -- font id: 0
  168. -- text size: 12
  169. -- style flags: 0
  170. -- line height: 16
  171. -- part name: SD
  172.  
  173.  
  174. -- part contents for background part 30
  175. ----- text -----
  176. 23
  177.  
  178. -- part contents for background part 21
  179. ----- text -----
  180. Auxiliary X-Commands
  181.  
  182. -- part contents for card part 1
  183. ----- text -----
  184. These X-commands were used in the preparation of this stack, and are part of the ShowDialog "package."
  185.  
  186. -- part contents for background part 15
  187. ----- text -----
  188. SplashDialog XCMD 1.0  
  189. Copyright┬⌐ 1989 by Jay Hodgdon
  190.  
  191.  SplashDialog makes for a simple "About..." dialog that can be shown at stack "launch" time.  It displays a 
  192. "timed" dialog containing a graphic that dismisses itself after a specified period of time.  
  193.  
  194. ΓÇó Click┬áhere┬áfor┬áa┬ádemo ΓÇó
  195.  
  196. If you desire, the dialog may be preceeded by and followed by a zooming effect.  The dialog will appear to zoom in from the top, left corner of the Macintosh screen.  The effect begins at the edge of the SCREEN, NOT the card window.  The effect even works when your color monitor is set for color! 
  197.  
  198. Its parameters are:
  199.  
  200. SplashDialog <DLOG ID>,<time delay>,<zoom BOOLEAN>
  201. [,<top coord>,<left coord>]
  202.  
  203. where 
  204. <DLOG ID> is the resource ID of the dialog to display;
  205. <time delay> is the length of time in seconds that the splash screen is displayed;
  206. <zoom BOOLEAN> is TRUE for zooming or FALSE for no zooming;
  207.  
  208. The last two parameters are OPTIONAL.  If they are omitted, the dialog is centered within the card window.
  209.  
  210. If the specified DLOG resource is missing, or an incorrect number of parameters is passed, the dialog exits with a beep.
  211.  
  212. Constructing a SplashDialog DLOG/DITL template:
  213. The SplashDialog template can contain any number of PICT and Static Text DITL items.  They should all be DISABLED because no interaction takes place between the dialog and the user.
  214.  
  215.  
  216.  
  217. -- part contents for background part 17
  218. ----- text -----
  219. CreditsDialog XCMD 1.11
  220. Copyright┬⌐ 1988, 1989 by Jay Hodgdon
  221.  
  222. CreditsDialog displays a dialog that contains two different PICTs.  When the dialog is clicked on, the first PICT is swapped out for the second.  When the dialog is clicked again, it is dismissed.  (Hitting enter or return is the same as clicking the mouse on the dialog.)  The dialog zooms in from the top, left corner of the Macintosh screen (NOT the card window).  This makes for a handy "About..." dialog.
  223.  
  224. ΓÇó Click┬áhere┬áfor┬áa┬ádemo ΓÇó  
  225.  
  226. Its parameters are:
  227.  
  228. CreditsDialog <DLOG ID>,<1st PICT ID#>,
  229. <2nd PICT ID#>[,<top coord>,<left coord>]
  230.  
  231. where 
  232. <DLOG ID> is the resource ID of the dialog to display;
  233. <1st PICT ID#> is the resource ID of the first PICT that is displayed;
  234. <2nd PICT ID#> is the resource ID of the second PICT that is displayed;
  235.  
  236. The last two parameter are OPTIONAL.  If they are omitted, the dialog is centered within the card window.
  237.  
  238. If the specified DLOG resource is missing, or an incorrect number of parameters is passed, the dialog exits with a beep.
  239.  
  240. If the specified PICTs are missing, the XCMD beeps and displays an empty dialog.
  241.  
  242. Constructing a CreditsDialog DLOG/DITL template:
  243. A CreditsDialog template should contain at least two DITL items:
  244.  
  245. DITL item#1 is an ENABLED useritem that should cover the ENTIRE area of the dialog window.  It is a mouse click on this item that will swap the PICTs (and dismiss the dialog).
  246.  
  247. DITL item#2 is a DISABLED useritem into which the PICTs will be drawn.  This item, naturally, will overlap with DITL item#1.  The rect of this item must be large enough to contain the PICT.  Otherwise the PICT will be squished down to fit into it (this is unsightly!).  The PICT will be centered within this item.
  248.  
  249. If you want to get tricky, the dialog can contain other DITL items (other PICTs or text) that will remain 
  250. "static"  as the other PICTs are swapped.  These other DITL items must not overlap with DITL item#2 
  251. (because the rect of DITL item#2 is cleared before the PICTs are swapped).
  252.  
  253. Revision history:
  254. 1.0          11/11/88
  255. initial release.
  256. 1.1          12/18/88
  257. added "zooming" before and after dialog is displayed.
  258. 1.11        12/23/88
  259. eliminated white spot left behind when the dialog is dismissed (prior to "zoom out").
  260.  
  261.  
  262.  
  263. -- part contents for background part 31
  264. ----- text -----
  265. To be announced...
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273.  
  274. -- part contents for background part 18
  275. ----- text -----
  276. TextDialog XCMD 1.3
  277. ┬⌐Copyright 1988, 1989 by Jay Hodgdon
  278.  
  279. This version is not the one that will be in the "release" ShowDialog 1.6 stack.  This version does not support mixed-style text.
  280.  
  281. ΓÇó Click┬áhere┬áfor┬áa┬ádemo ΓÇó
  282.  
  283.      TextDialog XCMD displays a dialog that can show up to 255 scrolling text screens, each containing up to 32K of text.  A TextDialog dialog is "semi-modal."  It can have a titlebar that allows it to be dragged around the screen, but it must be dismissed before other actions can be taken.
  284.  
  285. Scrolling of the TextDialog field is under full keyboard control:
  286.  
  287. ΓÇó Pressing the Home or End keys on the extended keyboard will scroll the field either to the top or bottom.
  288. ΓÇó Pressing the arrow up or arrow down keys will scroll the field one line at a time.  Pressing these same keys with the command key held down will scroll the field an entire page.
  289. ΓÇó Pressing the page up or page down keys will scroll the screen an entire page.
  290. ΓÇó Pressing the arrow left or arrow right keys will cycle text screens in the same mannor as pressing the Prev or Next buttons.
  291. ΓÇó Pressing enter or return or clicking the goAway box on the titlebar cancels the dialog.
  292.  
  293. Its parameters are:
  294.  
  295. TextDialog <DLOG ID>,<font>,<pt. size>,<TEXT screens>,<1st screen>[,<top>,<left>]
  296.  
  297. where
  298. <DLOG ID> is the DLOG resource ID for the dialog;
  299. <font> is the font name that the text will appear in;
  300. <pt. size> is the point size that the text will appear in;
  301. <TEXT screens> is a comma-delimited list of the TEXT resource ID's that will be shown in the dialog;
  302. <1st screen> is the item number from the <TEXT screens> list specifying which screen will be shown when the dialog is initially displayed.
  303.  
  304. The last two parameters are OPTIONAL.  If they are omitted, the dialog will be centered within the card window.
  305.  
  306. If you request a point size less than 7, you will get 9 pt. as default (point sizes less than 7 can't be read on a Macintosh screen!).  If you specify a point size that is larger than 24 pt. you'll get 9 pt. instead.  If you specify a font name that isn't available, you'll get Chicago 12 pt. by default.
  307.  
  308. Constructing a TextDialog DLOG/DITL template:
  309.  
  310. If you wish your TextDialog dialog to be "draggable," assign the DLOG template a procID of 0, which will give it a menubar.  It CAN have a goAway box in the titlebar, if you desire.
  311.  
  312. DITL item# 1: an ENABLED button (the Cancel button)
  313. DITL item#2: a DISABLED useritem (the rect that the text will be displayed in)
  314. DITL item#3: an ENABLED button (the PREV button)
  315. DITL item#4: an ENABLED button (the NEXT button)
  316.  
  317. When placing DITL item #2 (which will be the rect of the display text field) remember to leave a 17 pixel-wide space to the RIGHT that will be occupied by the scroll bar.
  318.  
  319. For aesthetic reasons (so that you will never see the bottom line of text in the display text field cut off), TextDialog first computes how many lines of text can fit in the display rectangle, given the font and size that you specify, and resizes the bottom of DITL item #2 so that its length is an exact multiple of the line height of the text.  Because of this, you may notice that the outline of the display rectangle doesn't EXACTLY match DITL #2 (it may be a bit longer or shorter).
  320.  
  321. TextDialog uses TEXT resources for the contents of the text screens.  The TEXT resources are created with ResEdit.  To make a TEXT resource, write your text with your favorite word processor.  Copy it to the clipboard.  Open the stack with ResEdit.  Create a new TEXT resource and copy the text in.  Make a note of the resource ID for the <TEXT screens> parameter.
  322.  
  323. Remaining DITL items can be Static Text, icons, or PICTs.
  324.  
  325. Revision history:
  326. 1.0        11/16/88:  obtains data for the text screens from HyperCard fields or HyperTalk variables.
  327. 1.1        11/17/88:  added parameter to choose which screen is initially displayed.
  328. 1.2        11/20/88:  switched to using TEXT resources for the contents of the screens.
  329. 1.22      3/3/89:  added parameters for specification of font and point size.
  330. 1.3         5/3/89:  made dialog "semi-modal" and the text field scrollable.
  331.  
  332.